package com.sikaryofficial.workbench.api;

import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.common.log.annotation.Log;
import com.sikaryofficial.common.log.enums.BusinessType;
import com.sikaryofficial.workbench.domain.dto.req.order.OrderCustomizedReq;
import com.sikaryofficial.workbench.manager.OrderManager;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author : wuweihong
 * @desc : 定制订单管理-外部接口
 * @date : 2024-11-18
 */


@RestController
@RequestMapping("/order/customized/api")
@Api(tags = "定制订单管理-外部接口")
@Slf4j
public class OrderCustomizedApi {

	@Autowired
	private OrderManager orderManager;

	@Log(title = "创建定制口味", businessType = BusinessType.INSERT)
    @ApiOperation("工作台-创建定制口味")
    @PostMapping("")
    public R<Void> syncOrderCustomize(@Validated @RequestBody List<OrderCustomizedReq> reqs) {
        orderManager.saveOrderCustomized(reqs);
        return R.ok();
    }

}
